#{extends 'frameHome.html' /} #{set title:'Idea' /}

<head>
<link rel="stylesheet" href="@{'/public/stylesheets/forms.css'}">

<link rel="stylesheet" href="@{'/public/stylesheets/main.css'}">

<link rel="stylesheet" href="@{'/public/stylesheets/css3buttons.css'}">


</head>

<div id=main>


<hr /> 


#{if idea.topic}
<p><b>Idea Topic Title:<a href="@{Topics.showTopic(idea.topic.id)}" > ${idea.topic.title}</a> </b></p>
<p><b> in Entity:<a href="@{Entity.viewEntity(idea.topic.entity.id)}" > ${idea.topic.entity.entityName}
</a></b></p> 
<p><b>
in Organization: <a href="@{Organizations.showOrganization(idea.topic.entity.organization.id)}" >${idea.topic.entity.organization.name} 
</a></b></p> 
#{/if}

#{if idea.entity}
<p><b>Idea Entity Name: <a href="@{Entity.viewEntity(idea.entity.id)}" >${idea.entity.entityName}</a>
<p><b>in Organization: <a href="@{Organizations.showOrganization(idea.entity.organization.id)}" >${idea.entity.organization.name}</a></b></p>
#{/if}

#{if idea.organization}
<p><b>Idea Organization Name:<a href="@{Organizations.showOrganization(idea.organization.id)}" >${idea.organization.name}</a>
 </b></p>
#{/if}



<p> Idea Title: ${idea.title}<p>
<p> Idea Body: ${idea.body}<p>
<p> Posted By: ${idea.author.name}<p>
<p> Priority: ${idea.priority}<p>
<p> Date of Creation: ${idea.postedAt}<p>
<p> Status of Idea: #{if idea.hide==true} 
idea is <b>hidden</b> 
<a href="@{PostingIdea.unhideIdea(idea.id)}" onclick="return confirm ('Are you sure you want to unhide this idea?');" class=" pill button">UnHide Idea</a>
#{/if}
#{else} 
idea is <b>unhidden</b> 
#{/else}</p>


<br>
<a href="@{PostingIdea.justificationNoteForOrganizer(idea.id)}" class=" button"><span class="calendar icon"></span>Manage Idea</a>
</br>



</div>

<p><b> Idea is tagged in :
#{if idea.tags}
#{list items:idea.tags, as:'tag'}
<ul>
<li><a href="@{Tags.ShowTag(tag.id)}">${tag.name} </a></li>
</ul>
#{/list}
#{/if}
#{else}
No Tags !!
#{/else}
</b></p>



<u><b>Discussion:</b></u> <br></br>

<br>
 <form action= "@{Comments.Post(idea.id)}"   method="Post">
 
         <h> Post your comment:</h> 
         <br> 
	   <textarea cols="50" rows="4" name="body" required="true"></textarea>
	    <input class="button" type="submit" value=" Comment">
	   
</form>
</br>
<form action= "@{Comments.postOnIdeaForOgranizer(idea.id)}"   method="Post">
	  <div class="Comments">
        <h3>
            ${idea.comments.size() ?: 'no'} 
            comment${idea.comments.size().pluralize()}
        </h3>
        #{list items:idea.comments, as:'comment'}
           <div class=comment>
           
                <li>${comment.body} </li> 
                <a href="@{Comments.deleteCommentForIdeaOrganizer(comment.id,idea.id)}" class="negative button"><span class="cross icon"></span>Delete Comment</a>
                
                </div>
                </div>
                <div class=commentfooter>
               
                    <span class="comment-commentator">by ${comment.commentator.name},</span>
                    <span class="comment-date">
                        
                    </span>
                </div>
                
                
<br/>
 #{/list}

</form>